<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
// import Joomla view library
jimport('joomla.application.component.view');
 
/**
 * Cpanel View
 */
class ShopViewShop extends JView
{
	/**
	 * Cpanel view display method
	 * @return void
	 */
	function display($tpl = null) 
	{
		$this->category = $this->get('Category');
		$this->product = $this->get('Products');
		$this->order = $this->get('Orders');
		$this->addToolBar();
		// Display the template
		parent::display($tpl);
		ShopHelper::addSubmenu('');
	}
	/**
	 * Setting the toolbar
	 */
	protected function addToolBar() 
	{
		JToolBarHelper::title(JText::_('COM_SHOP_CPANEL'),'cpanel_shop');
		$canDo = ShopHelper::getActions();
		if ($canDo->get('core.admin')) 
		{
			JToolBarHelper::divider();
			JToolBarHelper::preferences('com_shop');
		}
		$document = JFactory::getDocument();
		$document->addStyleDeclaration('.icon-48-cpanel_shop {background-image: url(components/com_shop/images/cpane_icon.png);}');
	}
}